Hi Az,
CheckDone() basically returns 1 when the axis is done and 0 if the axis is not done.
In C zero is considered "false" and anything else is considered
"true"
The statement:
while (ReadBit(CheckDone(0)));
doesn't really make any sense. It will end up looping depending on the state of bit 0 or 1.
Instead just use:
while (CheckDone(0)==0); // loop while Axis 0 Done is false
Or another way:
while (!CheckDone(0)); // loop while not Done Axis 0
To wait for more than one axis you might use:
while (!CheckDone(0) || !CheckDone(1)); // loop while not Done Axis 0 OR not Done Axis
1
HTH
Regards
TK
| Group: DynoMotion |
Message: 9368 |
From: Tom Kerekes |
Date: 3/24/2014 |
| Subject: Re: Motion in K flop |
Hi Az,
CheckDone() basically returns 1 when the axis is done and 0 if the axis is not done.
In C zero is considered "false" and anything else is considered
"true"
The statement:
while (ReadBit(CheckDone(0)));
doesn't really make any sense. It will end up looping depending on the state of bit 0 or 1.
Instead just use:
while (CheckDone(0)==0); // loop while Axis 0 Done is false
Or another way:
while (!CheckDone(0)); // loop while not Done Axis 0
To wait for more than one axis you might use:
while (!CheckDone(0) || !CheckDone(1)); // loop while not Done Axis 0 OR not Done Axis
1
HTH Regards TK
| Group: DynoMotion |
Message: 9369 |
From: az@aimele.com |
Date: 3/25/2014 |
| Subject: Re: Motion in K flop |
|
Thank you Tom,
That sound you heard was me giving myself a dope slap.
AZ
| | | |